{% extends 'base.html' %}
{% load i18n %}

{% block head %}
  <link href="{{ STATIC_URL }}css/feeds.css" rel="stylesheet">
  <script src="{{ STATIC_URL }}js/jquery.bullseye-1.0-min.js"></script>
  <script src="{{ STATIC_URL }}js/feeds.js"></script>
{% endblock head %}

{% block nav %}
  <li class="active"><a href="{% url 'feeds' %}">{% trans 'Feed' %}</a></li>
  <li><a href="{% url 'articles' %}">{% trans 'Articles' %}</a></li>
  <li><a href="{% url 'questions' %}">{% trans 'Q&A' %}</a></li>
  <li><a href="{% url 'about' %}">{% trans 'About'%}</a></li>
{% endblock nav %}

{% block main %}
  <div class="page-header">
    {% if not hide_profile %}
    <button type="button" class="btn btn-primary pull-right btn-compose" title="{% trans 'Press Ctrl + P to compose' %}">
      <span class="glyphicon glyphicon-share-alt"></span> {% trans 'Compose' %}
    </button>
    {% endif %}
    {% if hide_profile %}
    <button type="button" class="btn btn-primary pull-right btn-login" title="{% trans 'Press Ctrl + P to compose' %}">
      <span class="glyphicon glyphicon-share-alt"></span> {% trans 'Compose' %}
    </button>
    {% endif %}
    <h1>宁强圈</h1>
  </div>
  {% if not hide_profile %}
    <div class="compose">
      <h2>{% trans "Compose a new post" %}</h2>
      <form role="form" id="compose-form">
        {% csrf_token %}
        <input type="hidden" name="last_feed">
        <div class="form-group">
          <textarea class="form-control" rows="3" name="post"></textarea>
        </div>
        <div style="margin-bottom:10px">
{% for item in cg_list %}
        <label class="radio-inline">
          <input type="radio" name="category" id="category" value={{ item.0 }}{% if active == item.0 %} checked{% endif %}>{{ item.1 }}
        </label> 
{% endfor %}
        </div>
        <div class="form-group">
          <button type="button" class="btn btn-primary btn-post">
            <span class="glyphicon glyphicon-send"></span> {% trans 'Post' %}
          </button>
          <button type="button" class="btn btn-default btn-cancel-compose">{% trans 'Cancel' %}</button>
          <span class="help-block help-count pull-right">255</span>
        </div>
      </form>
    </div>
    <div class="stream-update">
      <a href="#"><span class="new-posts"></span> {% trans 'new posts' %}</a>
    </div>
  {% endif %}
  <div class="row results" style="margin-top: 15px">
    <div class="col-md-3">
      {% include 'feeds/feeds_menu.html' with active=active count=count %}
    </div>
    <div class="col-md-9">
    <ul class="stream1">
      {% for feed in up_feeds %}
        {% include 'feeds/partial_feed.html' with feed=feed up='true'%}
      {% endfor %}
      <hr/>
    </ul>
    <ul class="stream">
      {% for feed in feeds %}
        {% include 'feeds/partial_feed.html' with feed=feed %}
      {% endfor %}
    </ul>
    <div class="load">
      <img src="{{ STATIC_URL }}img/loading.gif">
    </div>
    <form method="get" action="{% url 'load' %}" id="load_feed" autocomplete="off">
      <input type="hidden" name="feed_source" id="feed_source" value="all">
      <input type="hidden" name="from_feed" value="{{ from_feed }}">
      <input type="hidden" name="page" value="{{ page }}">
      <input type="hidden" name="active" id="active" value="{{ active }}">
    </form>
    </div>
  </div>
{% endblock main %}
